﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CaipinshezhiInfo.aspx.cs" Inherits="Catering.Catering_Page.Caipin.Caipin_jcsz.CaipinshezhiInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../../Style/center.css" />
    <link href="../../../../Style/StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="../../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../../Scripts/tinybox.js" type="text/javascript"></script>
    <script src="../../../../Style/xxk.js" type="text/javascript"></script>
    <script src="../../../Scripts/zhezhao.js" type="text/javascript"></script>
    <style type="text/css">
        .Create_Recipe
        {
            margin-top: 0;
        }
        .Create_Recipe
        {
            border: 1px solid #159aec;
            border-top: none;
            width: 998px;
        }
        .soso_lt
        {
            padding: 5px 0;
        }
        .soso_lt a
        {
            margin-left: 3px;
        }
        
        a.add_new1
        {
            position: absolute;
            top: 8px;
            right: 10px;
            background: url(../../Images/jiahao.gif) left center no-repeat;
            padding-left: 15px;
        }
        a.add_new1:link, a.add_new:visited
        {
            color: #de10ab;
        }
        a.add_new1:hover
        {
            color: #000;
        }
        
        a.add_innsert1
        {
            position: absolute;
            top: 8px;
            right: 60px;
            background: url(../../Images/jiahao.gif) left center no-repeat;
            padding-left: 15px;
        }
        a.add_innsert1:link, a.add_innsert:visited
        {
            color: #de10ab;
        }
        a.add_innsert1:hover
        {
            color: #000;
        }
        
        .link_add{background-image:url('../../../Images/link_add.png'); width:57px; height:20px; text-align:right; display:block;}
        .link_save{background-image:url('../../../Images/link_save.png'); width:57px; height:20px; text-align:right; display:block;}
        .link_fanhui{background-image:url('../../../Images/link_fanhui.png'); width:57px; height:20px; text-align:right; display:block;}
        .swxx_table th{height:29px; line-height:29px;background: url("../../../Images/th_02bg.gif") repeat-x 0px 0px; font-weight:normal;}
        .swxx_table tbody td{ text-align:center; padding:0px; min-height:26px;}
        .tab_cpxx td{padding:5px 0px;}
    </style>
        <!---上传图片----->
    <script type="text/javascript">
        $(document).ready(function () {
            $('.pop_dl>dt>span').click(function () {
                $("#popbg").fadeOut();
                $('.pop_dl').fadeOut();
            });
            $("#btn_show").click(function () {
                showSearch();
            });

            $("#ButOk").click(function () {
                $("#popbg").fadeOut();
                $('.pop_dl').fadeOut();
            });
        });

        function UpPoto_Click() {
            popdiv("#pol_search", "500", "auto", 0.2);
        }

        function popdiv(popdiv, width, height, alpha) {
            var A = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
            var D = 0;
            D = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
            if (D == 0) {
                D = Math.max(document.body.clientHeight, document.documentElement.clientHeight)
            }
            var topheight = (A + (D - 300) / 2) + "px";
            $("#popbg").css({ height: $(document).height(), filter: "alpha(opacity=" + alpha + ")", opacity: alpha })
            $("#popbg").fadeIn();

            $(popdiv).css({ left: (($(document).width()) / 2 - (parseInt(width) / 2)) + "px", top: "500px" });
            $(popdiv).fadeIn();
        }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.pop_dl>dt>span').click(function () {
                $("#popbg").fadeOut();
                $('.pop_dl').fadeOut();
            });
            $("#btn_show").click(function () {
                showSearch();
            });

            $("#but_Raw_Up").click(function () {
                $("#popbg").fadeOut();
                $('.pop_dl').fadeOut();
            });

            if (selectedid==2) {
                $("#txt_AddEN").removeClass("link_add");
                $("#txt_AddEN").addClass("link_fanhui");
            }
            else {
                $("#txt_AddEN").removeClass("link_fanhui");
                $("#txt_AddEN").addClass("link_add");
            }
        });

        function Up_Raw_Poto_Click() {
            popdiv("#pol_search", "500", "auto", 0.2);
        }

        function popdiv(popdiv, width, height, alpha) {
            var A = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
            var D = 0;
            D = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
            if (D == 0) {
                D = Math.max(document.body.clientHeight, document.documentElement.clientHeight)
            }
            var topheight = (A + (D - 300) / 2) + "px";
            $("#popbg").css({ height: $(document).height(), filter: "alpha(opacity=" + alpha + ")", opacity: alpha })
            $("#popbg").fadeIn();

            $(popdiv).css({ left: (($(document).width()) / 2 - (parseInt(width) / 2)) + "px", top: "100px" });
            $(popdiv).fadeIn();
        }
    </script>
    <!-----更改数量---->
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#New_Raw_Row input").bind("propertychange", Txt_Number_Chanage)
        });
        //动态修改元素含量
        function Txt_Number_Chanage() {
            //alert("13");
            var Txt_NumberID = $(this).attr("RawID");
            var Nunmber = $(this).val();
            $.ajax({
                type: "Post",
                url: "CaipinshezhiInfo.aspx/RawNutrient",
                data: "{'Txt_NumberID':'" + Txt_NumberID + "','Nunmber':'" + Nunmber + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    for (var i = 1; i <= 24; i++) {
                        $("#lbl_" + i.toString()).html(data.d[i - 1]);
                    }
                }
            });
        }

        //删除原料
        function DelRaw(RawID) {
            $.ajax({
                type: "Post",
                url: "CaipinshezhiInfo.aspx/DelRawByRawID",
                data: "{'RawID':'" + RawID + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d[0] == "OK") {
                        $("#yuanliao_List_" + RawID).remove();
                        for (var i = 1; i <= 24; i++) {
                            $("#lbl_" + i.toString()).html(data.d[i]);
                        }
                    }
                }
            });
        }

        //添加原料
        function AddRaw(RawID) {
            $.ajax({
                type: "Post",
                url: "CaipinshezhiInfo.aspx/AddRawByRawID",
                data: "{'RawID':'" + RawID + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    if (data.d[0] == "OK") {
                        $("#btn_help").trigger("click");
                    }

                }
            });
        }
    
    </script>
    <!--切换树节点-->
    <script type="text/javascript">
        var selectedid = 1;
        if (window.parent.$("#Dish").css("display") == "none") {
            selectedid = 2;
        }
        function ShowDiv() {
            if (selectedid == 1) {
                window.parent.SetDiv('RawMaterial', 'Dish');
                $("#txt_AddEN").removeClass("link_add");
                $("#txt_AddEN").addClass("link_fanhui");
                selectedid = 2;
            }
            else {
                window.parent.SetDiv('Dish', 'RawMaterial');
                $("#txt_AddEN").removeClass("link_fanhui");
                $("#txt_AddEN").addClass("link_add");
                selectedid = 1;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Button ID="btn_help" runat="server" class="input_btn_a" OnClick="btn_help_Click" style="display:none;" />
    <div class="Right_CR">
        <div class="div_0207 left_width400" style="height:340px;">
            <table width="100%" style="background:url('../../../Images/div_h1_bg.gif');" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td><h1 style="background-image:none;"><img src="../../../Images/cp_h1_01.gif" />菜品信息</h1></td>
                    <td align="right">
                        <asp:ImageButton runat="server" ImageUrl="../../../Images/link_save.png" ID="btn_Save_Dish" onclick="btn_Save_Dish_Click"/>
                        <asp:ImageButton ID="bt_zengjia" ImageUrl="../../../Images/link_add.png" runat="server" OnClick="bt_zengjia_Click" />
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab_cpxx">
                <tr>
                    <td width="75" align="right" height="30">菜品名称：</td>
                    <td width="150"><asp:TextBox ID="Txt_caiming" runat="server" CssClass="input_bg" Width="150"></asp:TextBox></td>
                    <td rowspan="4" width="100" valign="top">
                        <div class="img_touxiang" style="text-align:center;">
                            <span style="margin-top:4px;"><asp:Image ID="ImgUpPoto" runat="server" ImageUrl="../../../Images/Gnome-Face.png" /></span><br /><a href="javascript:void(0);" style="margin:0px auto;" onclick="UpPoto_Click()">重设图片</a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="right">菜品分类：</td>
                    <td>
                        <asp:DropDownList ID="Dr_DishType" runat="server" CssClass="select_input_bg" Width="150" AutoPostBack="true"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="right"></td>
                    <td><asp:CheckBox ID="Cob_YouXian" runat="server" style="vertical-align:middle;" />有陷</td>
                </tr>
                <tr>
                    <td align="right">特　　点：</td>
                    <td><asp:TextBox ID="Txt_tedian" runat="server" CssClass="input_bg" TextMode="MultiLine" Height="63px" Width="150"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right">做　　法：</td>
                    <td colspan="2"><asp:TextBox ID="Txt_zuofa" runat="server" CssClass="input_bg" TextMode="MultiLine" Height="112px" Width="270"></asp:TextBox></td>
                </tr>
            </table>
            
        </div>
        <div class="div_0207 right_width" style="height: 502px;">
            <h1><img src="../../../Images/cp_h1_02.gif" />营养素信息</h1>
            <asp:Panel ID="Pan_NE" runat="server">
                <dl>
                    <dt>主要膳食营养素含量</dt>
                    <dd style="width:100%">
                        <table width="380" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td width="75" align="right">热　　量：</td>
                                <td width="120"><asp:Label ID="lbl_1" runat="server" Text="0"></asp:Label>千卡(kcal)</td>
                                <td></td>
                                <td width="80" align="right">蛋白质：</td>
                                <td width="100"><asp:Label ID="lbl_2" runat="server" Text="0"></asp:Label>克(g)</td>
                            </tr>
                            <tr>
                                <td align="right">脂　　肪：</td>
                                <td><asp:Label ID="lbl_3" runat="server" Text="0"></asp:Label>千卡(kcal)</td>
                                <td></td>
                                <td align="right">碳水化合物：</td>
                                <td><asp:Label ID="lbl_4" runat="server" Text="0"></asp:Label>克(g)</td>
                            </tr>
                            <tr>
                                <td align="right">膳食纤维：</td>
                                <td><asp:Label ID="lbl_5" runat="server" Text="0"></asp:Label>千卡(kcal)</td>
                                <td></td>
                                <td align="right"></td>
                                <td></td>
                            </tr>
                        </table>
                    </dd>
                </dl>
                <dl>
                    <dt>维生素</dt>
                    <dd style="width:100%">
                        <table width="380" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                 <td width="75" align="right">维生素A：</td>
                                <td><asp:Label ID="lbl_6" runat="server" Text="0"></asp:Label>微克(ug)</td>
                                <td></td>
                                <td align="right">维生素B1：</td>
                                <td><asp:Label ID="lbl_7" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                            </tr>
                            <tr>
                                <td align="right">维生素C： </td>
                                <td><asp:Label ID="lbl_9" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                                <td></td>
                                <td align="right">维生素B2：</td>
                                <td><asp:Label ID="lbl_8" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                            </tr>
                            <tr>
                                <td align="right">维生素E：</td>
                                <td><asp:Label ID="lbl_10" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                                <td></td>
                                <td align="right">视黄醇当量：</td>
                                <td><asp:Label ID="lbl_11" runat="server" Text="0"></asp:Label>微克(ug)</td>
                            </tr>
                            <tr>
                                <td align="right">尼克酸：</td>
                                <td><asp:Label ID="lbl_12" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                                <td></td>
                                <td align="right">胡萝卜素：</td>
                                <td><asp:Label ID="lbl_13" runat="server" Text="0"></asp:Label>毫克(mg)</td>
                            </tr>
                        </table>
                    </dd>
                </dl>
                <dl>
                    <dt>矿物质含量(毫克(mg))</dt>
                    <dd style="width:100%">
                        <table width="380" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td width="50" align="right">钙：</td>
                                <td width="100"><asp:Label ID="lbl_14" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td width="30" align="right">磷：</td>
                                <td width="100"><asp:Label ID="lbl_15" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td width="30" align="right">钾：</td>
                                <td width="100"><asp:Label ID="lbl_16" runat="server" Text="0"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="right">钠：</td>
                                <td><asp:Label ID="lbl_17" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right">镁：</td>
                                <td><asp:Label ID="lbl_18" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right">铁：</td>
                                <td><asp:Label ID="lbl_19" runat="server" Text="0"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="right">锌：</td>
                                <td><asp:Label ID="lbl_20" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right">硒：</td>
                                <td><asp:Label ID="lbl_21" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right">铜：</td>
                                <td><asp:Label ID="lbl_22" runat="server" Text="0"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="right">锰：</td>
                                <td><asp:Label ID="lbl_23" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right">碘：</td>
                                <td><asp:Label ID="lbl_24" runat="server" Text="0"></asp:Label></td>
                                <td></td>
                                <td align="right"></td>
                                <td></td>
                            </tr>
                        </table>
                    </dd>
                </dl>
            </asp:Panel>
        </div>
        <div class="div_0207 left_width400" style="height: 150px; overflow-y: auto; overflow-x:auto;">
            <table width="100%" style="background:url('../../../Images/div_h1_bg.gif');" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td><h1><img src="../../../Images/cp_h1_03.gif" />菜品原料信息</h1></td>
                    <td align="right">
                        <a href="javascript:void(0);" id="txt_AddEN" runat="server" onclick="ShowDiv();" class="link_add" >&nbsp;</a>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="swxx_table">
                <tr>
                    <th width="6%">序号</th>
                    <th width="11%">原料名称</th>
                    <th width="11%">种类</th>
                    <th width="8%">净用量</th>
                    <th width="7%">热量</th>
                    <th width="7%">删除</th>
                </tr>
                <tbody id="New_Raw_Row">
                    <%
                        System.Data.DataTable dt_yuanliao = (System.Data.DataTable)Session["dt_yuanliao" + Session["UserID"].ToString()];
                        if (dt_yuanliao != null && dt_yuanliao.Rows.Count > 0)
                        {
                            for (int i = 0; i < dt_yuanliao.Rows.Count; i++)
                            { 
                                %>
                                    <tr id="yuanliao_List_<%=dt_yuanliao.Rows[i]["RawID"].ToString()%>"  style="background: rgb(255, 255, 255);" onmouseover="this.style.background='#E3F5FF'" onmouseout="this.style.background='#FFFFFF'">
                                        <td class='xh_td'>
                                            <%=(i+1).ToString()%>
                                        </td>
                                        <td id='RawName'>
                                            <%=dt_yuanliao.Rows[i]["Food"].ToString() %>
                                        </td>
                                        <td>
                                            <%=dt_yuanliao.Rows[i]["zs"].ToString() %>
                                        </td>
                                        <td id='leibie'>
                                            <input type='text' RawID="<%=dt_yuanliao.Rows[i]["RawID"].ToString()%>" value='<%=dt_yuanliao.Rows[i]["zl"].ToString() %>' id='Txt_jinghanliang<%=dt_yuanliao.Rows[i]["RawID"].ToString() %>'
                                                style='width: 50px'  />
                                        </td>
                                        <td>
                                            <%=Convert.ToDecimal(dt_yuanliao.Rows[i]["Re"].ToString())%>
                                        </td>
                                        <td align='center'>
                                            <img src="../../../Images/trash.gif" onclick="DelRaw('<%=dt_yuanliao.Rows[i]["RawID"].ToString()%>')" />
                                        </td>
                                    </tr> 
                                <%
                            }
                        }     
                    %> 
                </tbody>
            </table>
        </div>
    </div>
    <div id="UpPoto_Dish">
        <div class="pop_dl" id="pol_search" style="width: 460px; border: #898989 10px solid; height: 100px;">
            <div style="background: url(../../../Images/div_h1_bg.gif) repeat-x 0px 0px; height:34px; line-height:32px; text-align:right; color:#000000;"><a href="#" id="but_Raw_Up">关闭</a>&nbsp;&nbsp;</div>
            <div style="padding:0px; margin:0px;">
                <table border="0" width="450px" style="background-color: White; color: Black; margin-top: 10px;" cellpadding="1" cellspacing="1">
                    <tr style="background-color: White;">
                        <td style="width: 80px; text-align: right;">
                            <asp:Label ID="Label4" runat="server" Text="文件上传：" Font-Size="11pt" Font-Bold="False" Font-Names="宋体" ForeColor="Black"></asp:Label>
                        </td>
                        <td style="width: 120px">
                            <asp:FileUpload ID="File_Upload" CssClass="input_bg" runat="server" />
                        </td>
                        <td style="width: 80px; text-align: right;">
                            <asp:Button ID="ButOk" runat="server" CssClass="input_btn_a" OnClick="butUpClose_Click" Text="确定" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="popbg">
        </div>
    </div>
    </form>
</body>
</html>
